package com.hutao.medical.mapper.quality;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.hutao.medical.pojo.quality.MedicalQuality;
import com.hutao.medical.pojo.vo.MedicalRecordVo;
import com.hutao.medical.pojo.vo.QueryMedQuaTotalParam;

public interface MedicalQualityMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MedicalQuality record);

    int insertSelective(MedicalQuality record);

    MedicalQuality selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MedicalQuality record);

    int updateByPrimaryKey(MedicalQuality record);
    
    /**
     * 根据firstGuid和功能类型查询质控信息
     * @param firstGuid
     * @param medicalFunctionType
     * @return
     */
    List<Map<String,Object>> getMedQualityByFirstGuidAndFunType(@Param("firstGuid") String firstGuid,@Param("medicalFunctionType")Integer medicalFunctionType);
    
    /**
     * 查询质控详情
     * @param medicalRecordVo
     * @return
     */
    List<Map<String,Object>> getMedicalQualityFunctionList(MedicalRecordVo medicalRecordVo);
    
    /**
     * 查询质控详情总数
     * @param medicalRecordVo
     * @return
     */
    int getMedicalQualityFunctionCount(MedicalRecordVo medicalRecordVo);
    
    /**
     * 查询首页质控信息
     * @param medicalRecordVo
     * @return
     */
    List<Map<String,Object>> getFirstMedQuaLityList(MedicalRecordVo medicalRecordVo);
    
    /**
     * 查询首页质控信息总条数
     * @param medicalRecordVo
     * @return
     */
    int getFirstMedQuaLityCount(MedicalRecordVo medicalRecordVo);
    
    

    
    List<Map<String,Object>> queryQualityGrandpaDefectProject(QueryMedQuaTotalParam param);
    
    List<Map<String,Object>> queryQualityFatherDefectProject(QueryMedQuaTotalParam param);
    
    List<Map<String,Object>> queryQualitySonDefectProject(QueryMedQuaTotalParam param);
   
    
    /**
     * 出院科室code
     * @param code
     * @return
     */
    List<String> getFirstGuidListByOfficeCode(@Param("code") String code);
    
    /**
     * 根据firstGuid查询扣除份数
     * @param firstGuid
     * @return
     */
     String getQcPointsByFirstGuid(@Param("firstGuid") String firstGuid);
     
     /**
      * 根据出院时间查询缺陷信息
      * @param queryMedQuaTotalParam
      * @return
      */
     List<Map<String,Object>> getMedicalDefaultTotalRateByOutTime(QueryMedQuaTotalParam queryMedQuaTotalParam);



     List<Map<String,Object>> getMedicalOfficeError(QueryMedQuaTotalParam queryMedQuaTotalParam);

     
     List<Map<String,Object>> getMedicalMrIdError(QueryMedQuaTotalParam queryMedQuaTotalParam);
}